package school;

public class Teacher {
    private String id;
    private String name;
    private String gender;
    private Course course;

    public Teacher(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public Course getCourse() {
        return course;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "教师编号：" + id + "，姓名：" + name + "，性别：" + gender + "，所授课程：" + (course != null? course.getName() : "无");
    }
}